<template>
	<div class="container">
		<div v-for="item in routes">
			<van-button :color="getColor()"  @click="toPage(item)" v-if="item.path!='/'">
				{{item.meta.title}}<br/>
				{{item.name}}
			</van-button>
		</div>
	</div>
</template>

<script>
export default {
	data() {
		return {
			routes:[]
		}
	},
	mounted(){
		this.routes = this.$store.state.routes
	},	
	methods: {
		toPage(item){
			// if(item.path=="/nucleicVisit"){
			// 	this.$router.push({
			// 		path:item.path,
			// 		query: {code:'021gJD0w3aP8rZ2wcXZv3MxJJf2gJD0a',state:443}
			// 	})
			// }else{
				this.$router.push({
					path:item.path,
				})
			// }

		},
		getColor(){
			let value1 = Math.round(Math.random()*255)
			let value2 = Math.round(Math.random()*255)
			let value3 = Math.round(Math.random()*255)
			return `rgb(${value1},${value2},${value3})`
		}
	}
}
</script>

<style lang="less" scoped>
	.container{
		text-align: center;
	}
	
</style>
